<?php
require_once '../sub/init.php';
header("Cache-control: private");
require_once 'chkUadm.php';
if(!in_array('nav',$QXARR))exit(noauth());
require_once ZEAI.'cache/config_up.php';
require_once ZEAI.'sub/zeai_up_func.php';
if ($submitok == "addupdate" || $submitok == "modupdate") {
	if(empty($title))json_exit(array('flag'=>0,'msg'=>'请输入【专题标题】'));
	if(empty($par))json_exit(array('flag'=>0,'msg'=>'请选择【条件/参数】'));
	if(empty($path_s))json_exit(array('flag'=>0,'msg'=>'请上传【首页小图标】'));
	if(empty($path_b))json_exit(array('flag'=>0,'msg'=>'请上传【详情页顶部大图】'));
	if(str_len($content)>1000)json_exit(array('flag'=>0,'msg'=>'【专题说明】请小于1000字节'));
	$title       = trimm(dataIO($title,'in',200));
	$content     = dataIO($content,'in');
	$bz          = dataIO($bz,'in',500);
	$wxshareT    = dataIO($wxshareT,'in',200);
	$wxshareC    = dataIO($wxshareC,'in',500);
	$par = dataIO($par,'in',500);
	$url = dataIO(trimhtml($url),'in',500);
	$showtype = (!ifint($showtype))?2:$showtype;
}
switch ($submitok) {
	case"addupdate":
		if(!empty($path_s)){
			adm_pic_reTmpDir_send($path_s,'form');
			$path_s = str_replace('tmp','form',$path_s);
		}
		if(!empty($path_s)){
			adm_pic_reTmpDir_send($path_b,'form');
			$path_b = str_replace('tmp','form',$path_b);
		}
		$db->query("INSERT INTO ".__TBL_IZT__." (title,content,path_s,path_b,bz,addtime,px,wxshareT,wxshareC,par,url,showtype) VALUES ('$title','$content','$path_s','$path_b','$bz',".ADDTIME.",".ADDTIME.",'$wxshareT','$wxshareC','$par','$url','$showtype')");	
		$id = intval($db->insert_id());
		AddLog('新增【首页专题】ID:'.$id.'，标题:'.$title);
		json_exit(array('flag'=>1,'msg'=>'新增成功'));
	break;
	case"modupdate":
		if(!ifint($id))json_exit(array('flag'=>0,'msg'=>'ID跑路了，请联系开发者【择。爱公司 www。zeai。cn】官方客服'));
		$row = $db->ROW(__TBL_IZT__,"path_s,path_b"," id=".$id,"num");
		if (!$row)json_exit(array('flag'=>0,'msg'=>'zeai_error_db_fid'.$id));
		$data_path_s= $row[0];
		$data_path_b= $row[1];
		$path_s  = tmp_piclist_modupdate($path_s,$data_path_s,'form','alone');
		$path_b  = tmp_piclist_modupdate($path_b,$data_path_b,'form','alone');
		AddLog('修改【首页专题】ID:'.$id.'，标题:'.$title);
		$db->query("UPDATE ".__TBL_IZT__." SET title='$title',content='$content',path_s='$path_s',path_b='$path_b',bz='$bz',wxshareT='$wxshareT',wxshareC='$wxshareC',par='$par',url='$url',showtype='$showtype' WHERE id=".$id);
		json_exit(array('flag'=>1,'msg'=>'修改成功'));
	break;
	case"ajax_pic_path_s_up":
		if (ifpostpic($file['tmp_name'])){
			$dbname = setphotodbname('tmp',$file['tmp_name'],$session_uid.'_');
			if (!up_send($file,$dbname,0,$_UP['upBsize']))json_exit(array('flag'=>0,'msg'=>'图片写入失败'));
			AddLog('【首页专题】上传图片->url:'.$dbname);
			json_exit(array('flag'=>1,'msg'=>'上传成功','dbname'=>$dbname));
		}else{
			json_exit(array('flag'=>0,'msg'=>'zeai_tmp_name_error'));
		}
	break;
	case"ajax_del":	
		if (!ifint($id))json_exit(array('flag'=>0,'msg'=>'专题不存在或已被删除'));
		$rt = $db->query("SELECT path_s,path_b,title FROM ".__TBL_IZT__." WHERE id=".$id);
		$total = $db->num_rows($rt);
		if ($total > 0 ) {
			for($i=1;$i<=$total;$i++) {
				$row = $db->fetch_array($rt,'name');
				if(!$row) break;
				$path_s = $row['path_s'];$path_b = $row['path_b'];$title = $row['title'];
				if(!empty($path_s) || !empty($path_b)){@up_send_admindel($path_s.'|'.$path_b);}
			}
			$db->query("DELETE FROM ".__TBL_IZT__." WHERE id=".$id);
			AddLog('删除【首页专题】->ID:'.$id.'，标题:'.$title);
		}
		json_exit(array('flag'=>1,'msg'=>'删除成功'));
	break;
	case"ajax_flag":
		if (!ifint($id))callmsg("ID跑路了","-1");
		$row = $db->ROW(__TBL_IZT__,"flag","id=".$id,"num");
		if(!$row){
			alert_adm("您要操作的信息不存在","-1");
		}else{
			$flag = $row[0];
			$SQL = "";
			switch($flag){
				case"-1":$SQL="flag=1";break;
				case"1":$SQL="flag=-1";break;
			}
			$db->query("UPDATE ".__TBL_IZT__." SET ".$SQL." WHERE id=".$id);
			AddLog('【首页专题】状态修改->id:'.$id);
			json_exit(array('flag'=>1,'msg'=>'设置成功'));
		}
	break;
	case"ding":
		if (!ifint($fid))alert_adm("forbidden","-1");
		$db->query("UPDATE ".__TBL_IZT__." SET px=".ADDTIME." WHERE id=".$fid);
		AddLog('【首页专题】置顶->id:'.$fid);
		header("Location: ".SELF);
	break;
	case"ajax_tjdiy":
		$SQL=array();
		$areaid = '';
		if (ifint($a1) && ifint($a2) && ifint($a3) && ifint($a4)){
			$areaid = $a1.','.$a2.','.$a3.','.$a4;
		}elseif(ifint($a1) && ifint($a2) && ifint($a3)){
			$areaid = $a1.','.$a2.','.$a3;
		}elseif(ifint($a1) && ifint($a2)){
			$areaid = $a1.','.$a2;
		}elseif(ifint($a1)){
			$areaid = $a1;
		}
		$areaid2 = '';
		if (ifint($h1) && ifint($h2) && ifint($h3) && ifint($h4)){
			$areaid2 = $h1.','.$h2.','.$h3.','.$h4;
		}elseif(ifint($h1) && ifint($h2) && ifint($h3)){
			$areaid2 = $h1.','.$h2.','.$h3;
		}elseif(ifint($h1) && ifint($h2)){
			$areaid2 = $h1.','.$h2;
		}elseif(ifint($h1)){
			$areaid2 = $h1;
		}
		if (!empty($areaid))$SQL['areaid']   = $areaid;
		if (!empty($areaid2))$SQL['areaid2'] = $areaid2;
		if (ifint($sex))$SQL['sex']          = $sex;
		if (ifint($age1))$SQL['age1']        = $age1;
		if (ifint($age2))$SQL['age2']        = $age2;
		if (ifint($pay))$SQL['pay']         = $pay;
		if (ifint($edu))$SQL['edu']         = $edu;
		if (ifint($job))$SQL['job']         = $job;
		if (ifint($love))$SQL['love']       = $love;
		if (ifint($child))$SQL['child']     = $child;
		if (ifint($marrytype))$SQL['marrytype'] = $marrytype;
		if (ifint($marrytime))$SQL['marrytime'] = $marrytime;
		if (ifint($heigh1))$SQL['heigh1']  = $heigh1;
		if (ifint($heigh2))$SQL['heigh2']  = $heigh2;
		if (ifint($weigh1))$SQL['weigh1']  = $weigh1;
		if (ifint($weigh2))$SQL['weigh2']  = $weigh2;
		if (ifint($car))$SQL['car']        = $car;
		if (ifint($house))$SQL['house']    = $house;
		if (ifint($smoking))$SQL['smoking'] = $smoking;
		if (ifint($drink))$SQL['drink']     = $drink;
		if (ifint($companykind))$SQL['companykind'] = $companykind;
		if (ifint($ifmob))$SQL['ifmob']     = $ifmob;
		if (ifint($regtime))$SQL['regtime']     = $regtime;
		if($ifdata50 == 1)$SQL['ifdata50']  = 1;
		if($ifparent == 1)$SQL['ifparent']  = 1;
		if ($photo_s == 1)$SQL['photo_s']   = 1;
		if ($grade2 == 1)$SQL['grade2']     = 1;
		if ($ifadmid == 1)$SQL['ifadmid']     = 1;
		if (ifint($grade))$SQL['grade']     = $grade;
		json_exit(array('flag'=>1,'msg'=>'设置成功','par'=>http_build_query($SQL)));
	break;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="<?php echo HOST;?>/res/www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="js/up.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script>var up2='<?php echo $_ZEAI['up2'];?>/',upMaxMB=<?php echo $_UP['upMaxMB']; ?>;</script>
<link href="css/main.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css">
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css">
<style>
td.tdLbgHUI{background-color:#eee}
.tips,.tips2{font-size:12px}
.table0 td{font-size:14px;padding:5px 0;text-align:left}
.table0 td input[type="text"]{margin:0 5px}
img.m{width:90px}
.box{min-width:1100px;padding:0}
</style>
</head>
<body <?php if($submitok == 'tjdiy')echo 'class="body"';?>>
<?php
if ($submitok == 'tjdiy'){
	require_once ZEAI.'cache/udata.php';
	$uroleStr = str_replace("g","i",$_ZEAI['urole']);
	$uroleStr = str_replace("t","v",$uroleStr);
	parse_str($par,$parARR);
	$pay=$parARR['pay'];
	$edu=$parARR['edu'];
	$job=$parARR['job'];
	$grade=$parARR['grade'];
	$regtime=$parARR['regtime'];
	$age1=$parARR['age1'];
	$age2=$parARR['age2'];
	$love=$parARR['love'];
	$child=$parARR['child'];
	$marrytime=$parARR['marrytime'];
	$sex=$parARR['sex'];
	$ifadmid=$parARR['ifadmid'];
	$heigh1=$parARR['heigh1'];
	$heigh2=$parARR['heigh2'];
	$car=$parARR['car'];
	$house=$parARR['house'];
	$marrytype=$parARR['marrytype'];
	$grade2=$parARR['grade2'];
	$photo_s=$parARR['photo_s'];
	$ifparent=$parARR['ifparent'];
	$weigh1=$parARR['weigh1'];
	$weigh2=$parARR['weigh2'];
	$smoking=$parARR['smoking'];
	$drink=$parARR['drink'];
	$companykind=$parARR['companykind'];
	$ifmob=$parARR['ifmob'];
	$ifdata50=$parARR['ifdata50'];
	$areaid=$parARR['areaid'];
	$areaid2=$parARR['areaid2'];
	$areaid=explode(',',$areaid);
	$areaid2=explode(',',$areaid2);
	if(count($areaid)>0){
		$a1=$areaid[0];
		$a2=$areaid[1];
		$a3=$areaid[2];
		$a4=$areaid[3];
	}
	if(count($areaid2)>0){
		$h1=$areaid2[0];
		$h2=$areaid2[1];
		$h3=$areaid2[2];
		$h4=$areaid2[3];
	}
	?>
	<script src="<?php echo HOST;?>/cache/udata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
    <script src="<?php echo HOST;?>/cache/areadata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
    <script src="<?php echo HOST;?>/res/select4.js?<?php echo $_ZEAI['cache_str'];?>"></script>
	<style>
    .table0{min-width:1400px;width:98%;margin:10px 20px 20px 20px}
    .mtop{ margin-top:10px;}
    .SW,.SW_area,.SW_age{padding:0 3px}
    .SW{width:100px}
    .SW_area{width:120px;vertical-align:middle}
    .SW_age{width:75px;padding:0}
    .RCW,.RCW2{display:inline-block}
    .RCW li{width:80px}
    .RCW2 li{width:120px}
    .formline{height:10px}
    select{color:#666}
    </style>
    <table class="table0">
    <tr>
    <td align="left" class="border0 S14" style="min-width:980px">
        <script>
            var nulltext = '--';
            function chkform(){
                if (age1.value > age2.value && (!zeai.empty(age1.value) && !zeai.empty(age2.value)) ){
                    zeai.msg('年龄请选择一个正确的区间（左小右大）',age1);	
                    return false;
                }
                if (heigh1.value > heigh2.value && (!zeai.empty(heigh1.value) && !zeai.empty(heigh2.value)) ){
                    zeai.msg('身高请选择一个正确的区间（左小右大）',heigh1);	
                    return false;
                }
            }
        </script>
        <form id="zeaiCN_FORM_gyl">
			月薪 <script>zeai_cn__CreateFormItem('select','pay','<?php echo $pay; ?>','class="size2 SW"',pay_ARR);</script>　
            学历 <script>zeai_cn__CreateFormItem('select','edu','<?php echo $edu; ?>','class="size2 SW"',edu_ARR);</script>　
            职业 <script>zeai_cn__CreateFormItem('select','job','<?php echo $job; ?>','class="size2 SW"',job_ARR);</script>　
            线上会员等级 <script>zeai_cn__CreateFormItem('select','grade','<?php echo $grade; ?>','class="size2  SW"',<?php echo $uroleStr;?>);</script>　
            时间排序 <script>zeai_cn__CreateFormItem('select','regtime','<?php echo $regtime; ?>','class="size2 SW"',[{i:"1",v:"最新注册"},{i:"2",v:"最后登录"}]);</script>
			<div class="formline"></div>
            
            年龄 <script>zeai_cn__CreateFormItem('select','age1','<?php echo $age1; ?>','class="size2 SW_age"',age_ARR);</script> ～ <script>zeai_cn__CreateFormItem('select','age2','<?php echo $age2; ?>','class="size2 SW_age"',age_ARR);</script>　
            婚姻 <script>zeai_cn__CreateFormItem('select','love','<?php echo $love; ?>','class="size2 SW"',love_ARR);</script>　
            子女 <script>zeai_cn__CreateFormItem('select','child','<?php echo $child; ?>','class="size2 SW"',child_ARR);</script>　
            结婚时间 <script>zeai_cn__CreateFormItem('select','marrytime','<?php echo $marrytime; ?>','class="size2 SW"',marrytime_ARR);</script>　
            性别 <script>zeai_cn__CreateFormItem('radio','sex','<?php echo $sex; ?>','class="size2 RCW"',sex_ARR);</script>
            <input type="checkbox" name="ifadmid" id="ifadmid" class="checkskin" value="1"<?php echo ($ifadmid == 1)?' checked':''; ?>><label for="ifadmid" class="checkskin-label"><i></i><b class="W50 S14">被认领</b></label>
            <div class="formline"></div>
            
            身高 <script>zeai_cn__CreateFormItem('select','heigh1','<?php echo $heigh1; ?>','class="size2 SW_age"',heigh_ARR);</script> ～ <script>zeai_cn__CreateFormItem('select','heigh2','<?php echo $heigh2; ?>','class="size2 SW_age"',heigh_ARR);</script>　
            车子 <script>zeai_cn__CreateFormItem('select','car','<?php echo $car; ?>','class="size2 SW"',car_ARR);</script>　
            房子 <script>zeai_cn__CreateFormItem('select','house','<?php echo $house; ?>','class="size2 SW"',house_ARR);</script>　
            嫁娶形式 <script>zeai_cn__CreateFormItem('select','marrytype','<?php echo $marrytype; ?>','class="size2 SW"',marrytype_ARR);</script>　
            <input type="checkbox" name="grade2" id="grade2" class="checkskin" value="1"<?php echo ($grade2 == 1)?' checked':''; ?>><label for="grade2" class="checkskin-label"><i></i><b class="W80 S14">线上VIP会员</b></label>　
            <input type="checkbox" name="photo_s" id="photo_s" class="checkskin" value="1"<?php echo ($photo_s == 1)?' checked':''; ?>><label for="photo_s" class="checkskin-label"><i></i><b class="W50 S14">有头像</b></label>　
            <input type="checkbox" name="ifparent" id="ifparent" class="checkskin" value="1"<?php echo ($ifparent == 1)?' checked':''; ?>><label for="ifparent" class="checkskin-label"><i></i><b class="W80 S14">父母帮征婚</b></label>　
            
            <div class="formline"></div>
            
            体重 <script>zeai_cn__CreateFormItem('select','weigh1','<?php echo $weigh1; ?>','class="size2 SW_age"',weigh_ARR);</script> ～ <script>zeai_cn__CreateFormItem('select','weigh2','<?php echo $weigh2; ?>','class="size2 SW_age"',weigh_ARR);</script>　
            吸烟 <script>zeai_cn__CreateFormItem('select','smoking','<?php echo $smoking; ?>','class="size2 SW"',smoking_ARR);</script>　
            饮酒 <script>zeai_cn__CreateFormItem('select','drink','<?php echo $drink; ?>','class="size2 SW"',drink_ARR);</script>　
            单位类型 <script>zeai_cn__CreateFormItem('select','companykind','<?php echo $companykind; ?>','class="size2 SW"',companykind_ARR);</script>　
            <input type="checkbox" name="ifmob" id="ifmob" class="checkskin" value="1"<?php echo ($ifmob == 1)?' checked':''; ?>><label for="ifmob" class="checkskin-label"><i></i><b class="W50 S14">有手机</b></label>　
            <input type="checkbox" name="ifdata50" id="ifdata50" class="checkskin" value="1"<?php echo ($ifdata50 == 1)?' checked':''; ?> ><label for="ifdata50" class="checkskin-label"><i></i><b class="W80 S14">资料>50%</b></label>
            
            <div class="formline"></div>
            
            工作地区 <script>LevelMenu4('a1|a2|a3|a4|--|<?php echo $a1; ?>|<?php echo $a2; ?>|<?php echo $a3; ?>|<?php echo $a4; ?>|areaid|areatitle','class="size2 SW"');</script>　
            户籍地区 <script>LevelMenu4('h1|h2|h3|h4|--|<?php echo $h1; ?>|<?php echo $h2; ?>|<?php echo $h3; ?>|<?php echo $a4; ?>|areaid2|areatitle2','class="size2 SW"');</script>
            
            <div class="formline"></div>
            
            <input name="id" type="hidden" value="<?php echo $id; ?>" />
            <input name="submitok" type="hidden" value="ajax_tjdiy" />
            <div style="margin:0 auto;text-align:center"><button type="reset" class="btn size3 BAI">重设清除</button>　<button type="button" class="btn size3" id="ok"><i class="ico">&#xe6b1;</i> 确定</button>　</div>
            
      </form>
    </td>
    </tr>
    </table>
	<script>
    ok.onclick=function(){
		chkform();
		zeai.ajax({url:'iZT'+zeai.extname,form:zeaiCN_FORM_gyl},function(e){var rs=zeai.jsoneval(e);
			zeai.msg(0);zeai.msg(rs.msg);
			if(rs.flag==1){
				window.parent.par.value=decodeURIComponent(rs.par);
				setTimeout(function(){window.parent.zeai.iframe(0);},1000);
			}
		});
	}
    </script>
<?php
exit;}?>


<div class="box">
	<div class="boxL"><a href="iZT.php" class='ed'>首页专题</a></div>
	<div class="boxR">
		<?php
        if ($submitok == 'add' || $submitok == 'mod'){
            if ($submitok == 'mod'){
                if(!ifint($id))alert_adm("ID去向不明","-1");
                $row = $db->ROW(__TBL_IZT__,"*","id=".$id,"name");
                if ($row){
                    $id       = $row['id'];
                    $title    = dataIO($row['title'],'out');
                    $content  = dataIO($row['content'],'wx');
                    $wxshareT = dataIO($row['wxshareT'],'wx');
                    $wxshareC = dataIO($row['wxshareC'],'wx');
                    $bz      = dataIO($row['bz'],'wx');
                    $path_s  = $row['path_s'];
                    $path_b  = $row['path_b'];
                    $url     = dataIO($row['url'],'out');
                    $addtime = $row['addtime'];
                    $flag    = $row['flag'];
                    $showtype = $row['showtype'];
                    $par     = dataIO($row['par'],'out');
                }
            }?>
            <form id="ZEAI_FORM">
            <table class="table size2 W98_" style="margin:0 auto">
            <tr><td class="tdL"><font class="Cf00">*</font> 专题标题</td><td class="tdR"><input name="title" id="title" type="text" class="input size2 W600" value="<?php echo $title;?>" maxlength="200"   autocomplete="off" /></td></tr>
            <tr><td class="tdL"><font class="Cf00">*</font> 设置条件/参数</td><td class="tdR"><input name="par" id="par" type="text" class="input size2 W600" value="<?php echo $par;?>" maxlength="200"   autocomplete="off" /> <button class="btn size2" type="button" onClick="tjdiy('<?php echo urlencode($title);?>',par.value)">设置条件</button></td></tr>
            <tr><td class="tdL">会员列表样式</td><td class="tdR">
    	<style>.listcls{font-size:30px;width:50px;height:50px;line-height:50px;color:#fff;text-align:center;border-radius:6px;margin-left:5px}</style>
    
        <input type="radio" name="showtype" id="list_showtype1" class="radioskin" value="1"<?php echo ($showtype == 1)?' checked':'';?>><label for="list_showtype1" class="radioskin-label"><i class="i1"></i><b class="W100"><span class="ico S16 zeaibg listcls">&#xe67a;</span><br>头像模式</b></label>
        <input type="radio" name="showtype" id="list_showtype2" class="radioskin" value="2"<?php echo ($showtype == 2)?' checked':'';?>><label for="list_showtype2" class="radioskin-label"><i class="i1"></i><b class="W100"><span class="ico S16 zeaibg listcls">&#xe65e;</span><br>列表模式</b></label>
        <input type="radio" name="showtype" id="list_showtype3" class="radioskin" value="3"<?php echo ($showtype == 3)?' checked':'';?>><label for="list_showtype3" class="radioskin-label"><i class="i1"></i><b class="W100"><span class="ico S16 zeaibg listcls">&#xe65f;</span><br>大图模式</b></label>
            
            </td></tr>
            
            <tr><td class="tdL lineH150"><font class="Cf00">*</font> 首页小图标<div class="S12 C999 lineH150">推荐240*240以内像素<br>jpg,gif,png格式</div></td><td class="tdR C8d">
            <div class="picli100" id="path_s_box">
                <li class="add" id="path_s_btn"></li>
                <?php if(!empty($path_s))echo '<li><img src="'.UP.$path_s.'"><i></i></li><br><span class="tips">先删除后更换</span>';?>
            </div>
            </td></tr>
            <tr><td class="tdL lineH150"><font class="Cf00">*</font> 详情页顶部大图<div class="S12 C999 lineH150">推荐750*750以内像素<br>jpg,gif,png格式</div></td><td class="tdR C8d">
            <div class="picli100" id="path_b_box">
                <li class="add" id="path_b_btn"></li>
                <?php if(!empty($path_b))echo '<li><img src="'.UP.$path_b.'"><i></i></li><br><span class="tips">先删除后更换</span>';?>
            </div>
            </td></tr>
            
            <tr><td class="tdL">专题说明</td><td class="tdR"><textarea id="content" name="content" rows="12" class="W700" placeholder="内容请控制在1000字以内"><?php echo $content;?></textarea></td></tr>

            <tr><td class="tdL ">微信分享标题</td><td class="tdR"><textarea name="wxshareT" id="wxshareT" rows="3" class="W700 S14"><?php echo $wxshareT;?></textarea></td></tr>
            <tr><td class="tdL ">微信分享描述</td><td class="tdR"><textarea name="wxshareC" id="wxshareC" rows="3" class="W700 S14"><?php echo $wxshareC;?></textarea></td></tr>
            <tr><td class="tdL">外链网址</td><td class="tdR"><input name="url" id="url" type="text" class="input size2 W600" value="<?php echo $url;?>" maxlength="500" autocomplete="off" /><span class="tips">如果填入URL网址，将直接跳转打开此网址，留空进入内置专题页</span></td></tr>

            <tr><td class="tdL">备注</td><td class="tdR"><textarea name="bz" rows="4" class="W700" placeholder="备注(500字节内，没有请留空)，不对外展示，内部备注"><?php echo $bz;?></textarea></td></tr>
            </table>
            <input name="submitok" type="hidden" value="<?php echo $submitok.'update';?>" />
            <input name="path_s" id="path_s" type="hidden" value="" />
            <input name="path_b" id="path_b" type="hidden" value="" />
            <?php if ($submitok == 'mod'){?><input name="id" type="hidden" value="<?php echo $id;?>" /><?php }?>
            </form>
        <?php }else{ ?>
            <!-- LIST -->
            <div class="topsearch">
            	<button type="button" class="btn size2" onClick="zeai.openurl('iZT.php?submitok=add')"><i class="ico">&#xe622;</i> 新增专题项目</button>
                <div class="rbox">
                <form name="ZEAI_CN__form1" method="get" action="<?php echo SELF; ?>">
                    <input name="Skey" type="text" id="Skey" maxlength="25" class="input size2 W200" placeholder="输入专题项目ID/标题" value="<?php echo $Skey; ?>">
                    <input type="hidden" name="p" value="<?php echo $p;?>" />
                    <button type="submit" class="btn size2"><i class="ico">&#xe6c4;</i> 搜索</button>
                </form>
                </div>
            </div>            
            <?php
            $SQL = "";
            $Skey = trimm($Skey);
            if (ifint($Skey)){
                $SQL = " WHERE id=$Skey ";
            }elseif(!empty($Skey)){
                $SQL = " WHERE title LIKE '%".$Skey."%' ";
            }
            $rt = $db->query("SELECT * FROM ".__TBL_IZT__.$SQL." ORDER BY px DESC,id DESC LIMIT ".$_ADM['admLimit']);
            $total = $db->num_rows($rt);
            if ($total <= 0 ){
                echo "<div class='nodataico'><i></i>暂无内容<br><a class='aQINGed' href='iZT.php?submitok=add'>新增专题</a></div>";
            } else {
                $page_skin=2;$pagemode=3;$pagesize=$_ADM['admPageSize'];require_once ZEAI.'sub/page.php';?>
                <form id="www_zeai_cn_FORM">
                    <table class="tablelist" >
                    <tr>
                    <th width="20"><input type="checkbox" id="checkboxall1" class="checkskin checkboxall"><label for="checkboxall1" class="checkskin-label"><i class="i1"></i></label></th>
                    <th width="40">ID</th>
                    <th width="50">置顶</th>
                    <th width="60" align="center">首页图标</th>
                    <th width="15" align="center">&nbsp;</th>
                    <th width="220" align="left">标题</th>
                    <th width="66" align="center">浏览二维码/网址</th>
                    <th align="center">&nbsp;</th>
                    <th width="100" align="left">显示条件/参数</th>
                    <th width="60" align="center">人气</th>
                    <th width="70" align="center">时间</th>
                    <th width="60" align="center">状态</th>
                    <th width="100" align="center">操作</th>
                    </tr>
                    <?php
                    for($i=1;$i<=$pagesize;$i++) {
                        $rows = $db->fetch_array($rt,'name');
                        if(!$rows) break;
                        $id = $rows['id'];
                        $title = dataIO($rows['title'],'out');
                        $title = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$title);
                        $addtime = YmdHis($rows['addtime']);
                        $path_s  = $rows['path_s'];
                        $flag    = $rows['flag'];
						$par    = dataIO($rows['par'],'out');$par=str_replace("&","<br>",$par);
                        $click = $rows['click'];
                        if(!empty($path_s)){
                            $path_s_url = $_ZEAI['up2'].'/'.$path_s;
                            $path_s_str = '<img src="'.$path_s_url.'">';
                        }else{
                            $path_s_url = '';
                            $path_s_str = '';
                        }
                        $path_s_url = (!empty($path_s))?$_ZEAI['up2'].'/'.$path_s:HOST.'/res/noP.gif';
                        $path_s_str = '<img src="'.$path_s_url.'" class="m">';
                        $ewmurl=urlencode(HOST.'/m/iZT.php?id='.$id);//.'&admid='.$session_uid
                    ?>
                    <tr id="tr<?php echo $id;?>">
                        <td width="20" height="40"><input type="checkbox" name="list[]" value="<?php echo $id; ?>" uid="<?php echo $senduid; ?>" id="id<?php echo $id; ?>" class="checkskin"><label for="id<?php echo $id; ?>" class="checkskin-label"><i class="i1"></i></label>
                        </td>
                      <td width="40"><label for="id<?php echo $id; ?>"><?php echo $id;?></label></td>
                      <td width="50"><a href="<?php echo "iZT.php?fid=".$id; ?>&submitok=ding" class="topico" title="置顶"></a></td>
                        <td width="60" align="center">
                        
                <a href="javascript:;" class="zoom" onClick="parent.piczoom('<?php echo smb($path_s_url,'b'); ?>');"><?php echo $path_s_str; ?></a>        
                        
                
                        </td>
                        <td width="15" align="center">&nbsp;</td>
                        <td width="220" align="left" class="S14"><a href="iZT.php?submitok=mod&id=<?php echo $id;?>&p=<?php echo $p;?>"><?php echo $title;?></a></td>
                        <td width="66" align="center"><a href="javascript:;" onclick="parent.zeai.iframe('【<?php echo $title;?>】二维码','u_ewm.php?url=<?php echo $ewmurl;?>&ifshowurl=1',400,400);" title="放大二维码/复制链接网址" class="zoom">
                <img src="images/ewm.gif" class="ewmpic">
                </a></td>
                        <td align="center">&nbsp;</td>
                        <td width="100" align="left"><?php echo $par;?></td>
                        <td width="60" align="center"><?php echo $click;?></td>
                      <td width="70" align="center" class="C999"><?php echo $addtime;?></td>
                      <td width="60" align="center" class="lineH200">
                            <?php if($flag==-1){?><a clsid="<?php echo $id;?>" class="aHEI flag">已隐藏</a><?php }?>
                            <?php if($flag==1){?><a clsid="<?php echo $id;?>" class="aLAN flag">正常</a><?php }?>
                      </td>
                      <td width="100" align="center">
                      <a href="iZT.php?submitok=mod&id=<?php echo $id;?>&p=<?php echo $p;?>" class="editbtn"></a>
                      <a class="delbtn" clsid="<?php echo $id;?>"></a>
                      </td>
                      </tr>
                    <?php } ?>
                </table>
                <?php if ($total > $pagesize){?>
                <div class="listbottombox" style="text-align:center">
                    <input type="checkbox" id="checkboxall2" class="checkskin checkboxall"><label for="checkboxall2" class="checkskin-label"><i class="i1"></i></label>　
                    <input type="hidden" name="submitok" id="submitok" value="" />
                    <?php echo '<div class="pagebox">'.$pagelist.'</div>'; ?>
                </div>
                <?php }?>
                </form>
                <script>
                var bg = '<?php echo $_Style['list_bg']; ?>',overbg = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';
                zeai.listEach('.delbtn',function(obj){
                    obj.onclick = function(){
                        var id = parseInt(obj.getAttribute("clsid"));
                        zeai.confirm('<b class="S18">确定真的要删除么？',function(){
                            zeai.ajax({url:'iZT'+zeai.ajxext+'submitok=ajax_del&id='+id},function(e){var rs=zeai.jsoneval(e);
                                zeai.msg(0);zeai.msg(rs.msg);
                                if(rs.flag==1){setTimeout(function(){location.reload(true);},1000);}
                            });
                        });
                    }
                });
                zeai.listEach('.flag',function(obj){
                    obj.onclick = function(){
                        var id = parseInt(obj.getAttribute("clsid"));
                        zeai.ajax({url:'iZT'+zeai.ajxext+'submitok=ajax_flag&id='+id},function(e){var rs=zeai.jsoneval(e);
                            zeai.msg(0);zeai.msg(rs.msg);
                            if(rs.flag==1){setTimeout(function(){location.reload(true);},1000);}
                        });
                    }
                });
                </script>
                <script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
            <?php }?>
        <?php }?>
	</div>
    <div class="clear"></div>
</div>
<?php if ($submitok == 'add' || $submitok == 'mod'){?>
	<div class="savebtnbox"><button type="button" class="btn size3" id="save">保存并发布</button></div>
	<script>
    save.onclick = function(){
		zeai.ajax({url:'iZT'+zeai.extname,form:ZEAI_FORM},function(e){var rs=zeai.jsoneval(e);
			zeai.msg(rs.msg);if(rs.flag==1)setTimeout(function(){zeai.openurl('iZT'+zeai.ajxext+'p=<?php echo $p;?>');},1000);
		});
    }
	adm_path_up({boxid:o(path_s_box),btnid:o(path_s_btn),inputid:o(path_s),url:'iZT.php',submitok_add:'ajax_pic_path_s_up'});
	adm_path_up({boxid:o(path_b_box),btnid:o(path_b_btn),inputid:o(path_b),url:'iZT.php',submitok_add:'ajax_pic_path_s_up'});
	function tjdiy(title2,par){zeai.iframe('【'+decodeURIComponent(title2)+'】条件筛选','iZT.php?submitok=tjdiy&par='+encodeURIComponent(par));}
    </script>
<?php }
require_once 'bottomadm.php';?>